package cn.lysj.framework.common.validate.validate;


import cn.lysj.framework.common.validate.annotation.NotBlank;
import cn.lysj.framework.common.validate.entity.Entity;

public class NotBlankValidate extends AbstractValidate<NotBlank> {

    public boolean validate(Entity entity) {
        if (null != entity.getValue() && !"".equals(entity.getValue())) {
            return !"".equals(String.valueOf(entity.getValue()).trim());
        }
        return false;
    }

    public void init() {
        this.setMsg(annotation.message());
        this.setGroups(annotation.groups());
    }
}
